package wsi.gui.detector;

import org.rygh.core.db.tuple.NamedModel;
import org.rygh.semantic.gui.swing.input.Input;

public class DetectorTuple extends NamedModel implements
		Comparable<DetectorTuple> {
	public enum Property {
		Value, WebCalls, Degree, MatchCount
	}

	private final Input input;

	private int matchCount = 0;

	public DetectorTuple(int id, Input input) {
		super(id, input.getEntity().getValue());

		this.input = input;

		set(Property.Value, input.getValue());
	}

	/**
	 * more match count, place upper.
	 */
	@Override
	public int compareTo(DetectorTuple o) {
		return o.matchCount - matchCount;
	}

	public Input getInput() {
		return input;
	}

	public void setDegree(int degree) {
		set(Property.Degree, degree);
	}

	public void setMatchCount(int matchCount) {
		this.matchCount = matchCount;
		set(Property.MatchCount, matchCount);
	}

	public void setWebCalls(int webCalls) {
		set(Property.WebCalls, webCalls);
	}

}
